{#
 This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0. If a copy of the MPL was not distributed with this
 file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% set utm_source = request.page_info.utm_source %}
{% set utm_campaign = request.page_info.utm_campaign %}
{% set utm_content = label.replace(' ', '-') %}
{% set referral = '?utm_source=' + utm_source + '&utm_medium=referral&utm_campaign=' + utm_campaign %}

{% if action == 'Download Firefox' %}

  <!-- TODO: unique dom_ID -->
  {{ download_firefox_thanks(dom_id='download-button-primary', alt_copy=label, button_class=button_class) }}

{% elif action == 'Explore Firefox' %}

  <a href="https://www.firefox.com/" class="mzp-c-button {{ button_class }}" data-cta-text="{{ cta_text }}" >{{ label }}</a>

{% elif action == 'Create a Firefox Account' %}

  {{ fxa_button(
    entrypoint=utm_source,
    button_text=label,
    class_name=button_class,
    optional_parameters={'utm_campaign': utm_campaign, 'utm_content': 'firefox-sync-' + utm_content },
    optional_attributes={'data-cta-text': cta_text, 'data-cta-type': 'fxa-sync'}
  ) }}

{% elif action == 'Get Mozilla VPN' %}

  <a href="{{ url('products.vpn.landing') }}" class="mzp-c-button {{ button_class }}" data-cta-text="{{ cta_text }}" data-cta-type="vpn">{{ label }}</a>

{% elif action == 'Try Relay' %}

  <a href="https://relay.firefox.com/{{ referral|safe }}" class="mzp-c-button {{ button_class }}" rel="external noopener" data-cta-text="{{ cta_text }}" data-cta-type="relay">{{ label }}</a>

{% elif action == 'Get MDN Plus' %}

  <a href="https://developer.mozilla.org/plus{{ referral|safe }}" class="mzp-c-button {{ button_class }}" rel="external noopener" data-cta-text="{{ cta_text }}">{{ label }}</a>

{% endif %}
